<nz-breadcrumb class="breadcrumb">
  <nz-breadcrumb-item>
    <a routerLink="/Home">首页</a>
  </nz-breadcrumb-item>
  <nz-breadcrumb-item>培训记录列表</nz-breadcrumb-item>
</nz-breadcrumb>
<form nz-form class="search-form" [formGroup]="searchForm" (keydown.enter)="$event.preventDefault();onSearch()" nzLayout="inline">
  <nz-form-item>
    <nz-form-label nzFor="candidateName">应聘者姓名</nz-form-label>
    <nz-form-control>
      <nz-input-group nzSearch [nzAddOnAfter]="candidateNameSuffixIconButton">
        <input nz-input formControlName="candidateName" placeholder="请选择应聘者姓名" readonly />
      </nz-input-group>
      <ng-template #candidateNameSuffixIconButton>
        <button nz-button nzType="primary" nzSearch (click)="findCandidate()" [disabled]="disableFindCandidateFormItem"><nz-icon nzType="search" /></button>
      </ng-template>
    </nz-form-control>
  </nz-form-item>
  <button nz-button type="button" nzType="primary" [nzLoading]="searchLoading" (click)="onSearch()">查询</button>
  <button nz-button type="button" class="margin-button" (click)="onReset()">重置</button>
  <button nz-button type="button" class="margin-button" nzType="primary" (click)="onAdd()">新增</button>
  <button nz-button type="button" class="margin-button" nzType="primary" [nzLoading]="searchLoading" (click)="onExport()">导出</button>
</form>
<nz-table #basicTable [nzData]="listOfData" [nzTotal]="total" [nzLoading]="searchLoading" nzSize="small">
  <thead>
    <tr>
      <th>应聘者姓名</th>
      <th>培训名称</th>
      <th>培训日期</th>
      <th>培训时长</th>
      <th>培训供应商</th>
      <th>培训内容</th>
      <th nzWidth="250px">操作</th>
    </tr>
  </thead>
  <tbody>
    <tr *ngFor="let data of basicTable.data">
      <td>{{data.candidateName}}</td>
      <td>{{data.trainingName}}</td>
      <td>{{data.trainingDate}}</td>
      <td>{{data.durationHours}}</td>
      <td>{{data.provider}}</td>
      <td class="ellipsis">{{data.trainingDescription}}</td>
      <td>
        <button nz-button type="button" nzType="primary" (click)="editRow(data.id)">编辑</button>
        <button nz-button type="button" nzDanger class="margin-button" (click)="delRow(data.id)">删除</button>
        <button nz-button type="button" class="margin-button" (click)="detailRow(data)">详情</button>
      </td>
    </tr>
  </tbody>
</nz-table>
<candidate-selector (candidateSelectedEvent)="handleCandidateSelectedEvent($event)"></candidate-selector>
<training-record-add (addedEvent)="onAdded($event)"></training-record-add>
<training-record-view></training-record-view>
